package com.hzqy.persistence.dao.hqjc;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.CmContentVo;
import com.hzqy.web.vo.CmRecommendVo;

@Repository
public class MultirateDao extends PersistenceDao<CmContentVo,Integer> {
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	
	public int selectContentCount(int f_catalog_id,String f_cp_cprid,int f_cc_definitionflag,String f_sa_id,String f_cc_name){
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("f_catalog_id", f_catalog_id);
		map.put("f_cp_cprid", f_cp_cprid);
		map.put("f_cc_definitionflag", f_cc_definitionflag);
		map.put("f_sa_id", f_sa_id);
		map.put("f_cc_name", f_cc_name);
		return getSqlSession().selectOne(this.getNamespace() + "selectContentCount", map);
	}
	
	public List<CmContentVo> selectContentList(int f_catalog_id,int pageNo,int pageSize,String f_cp_cprid,int f_cc_definitionflag,String f_sa_id,String f_cc_name) {
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("f_catalog_id", f_catalog_id);
		map.put("firstResult", pageNo);
		map.put("pageSize", pageSize);
		map.put("f_cp_cprid", f_cp_cprid);
		map.put("f_cc_definitionflag", f_cc_definitionflag);
		map.put("f_sa_id", f_sa_id);
		map.put("f_cc_name", f_cc_name);
		return getSqlSession().selectList(this.getNamespace() + "selectContentList", map);
	}
	
	public CmContentVo selectContent(int f_cc_id,int f_cp_cprid){
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("f_cc_id", f_cc_id);
		map.put("f_cp_cprid", f_cp_cprid);
		return getSqlSession().selectOne(this.getNamespace() + "selectContent", map);
	}
	
	public List<CmContentVo> selectContentMovList(int f_cc_multirateid) {
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("f_cc_multirateid", f_cc_multirateid);
		return getSqlSession().selectList(this.getNamespace() + "selectContentMovList", map);
	}
	
	public List<CmContentVo> selectContentSeries(int f_cc_multirateid) {
		return getSqlSession().selectList(this.getNamespace() + "selectContentSeries", f_cc_multirateid);
	}
	
	public int selectMultirateIDByCode(String f_cc_code) {
		return getSqlSession().selectOne(this.getNamespace() + "selectMultirateIDByCode", f_cc_code);
	}
}
